import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const baseUrl = '/child-app'

const routes = [
  {
    path: window.__POWERED_BY_QIANKUN__ ? baseUrl + '/' : '/',
    // path: baseUrl + '/',
    name: 'Home',
    component: Home
  },
  {
    path: baseUrl + '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  // mode: 'history',
  // base: window.__POWERED_BY_QIANKUN__ ? baseUrl : '/',
  routes
})

export default router;
